package com.dong.service.impl;

import com.dong.dao.VideoMapper;
import com.dong.entity.Video;
import com.dong.service.VideoService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class VideoServiceImpl implements VideoService {
    @Autowired
    private VideoMapper videoMapper;

    @Override
    public Video selectVideoById(Integer id) {
        Video video = videoMapper.selectVideoById(id);
        return video;
    }

    @Override
    public Integer addVideo(Video video) {
        Integer integer = videoMapper.addVideo(video);
        return integer;
    }

    @Override
    public Integer updateVideo(Video video) {
        Integer integer = videoMapper.updateVideo(video);
        return integer;
    }

    @Override
    public Integer deleteVideo(Integer id) {
        Integer integer = videoMapper.deleteVideo(id);
        return integer;
    }

    @Override
    public List<Video> selectAllVideo() {
        List<Video> videos = videoMapper.selectAllVideo();
        return videos;
    }
}
